package q1.project.modules.system.tenant.model;

import java.time.LocalDateTime;
import q1.project.common.enums.IsolationModeEnum;
import q1.project.common.enums.TenantStatusEnum;
import q1.project.common.enums.TenantTypeEnum;
import q1.project.core.base.PageQuery;

/**
 * @author Q1 Team
 */
public final class TenantVm {
  private TenantVm() {}

  public static class TenantQuery extends PageQuery {
    private String tenantCode;
    private String tenantName;
    private String status;
    private String type;
    private String isolationMode;

    public String getTenantCode() {
      return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
      this.tenantCode = tenantCode;
    }

    public String getTenantName() {
      return tenantName;
    }

    public void setTenantName(String tenantName) {
      this.tenantName = tenantName;
    }

    public String getStatus() {
      return status;
    }

    public void setStatus(String status) {
      this.status = status;
    }

    public String getType() {
      return type;
    }

    public void setType(String type) {
      this.type = type;
    }

    public String getIsolationMode() {
      return isolationMode;
    }

    public void setIsolationMode(String isolationMode) {
      this.isolationMode = isolationMode;
    }
  }

  public record TenantResponse(
      String id,
      String tenantCode,
      String tenantName,
      TenantTypeEnum tenantType,
      IsolationModeEnum isolationMode,
      String databaseName,
      TenantStatusEnum status,
      String adminUserId,
      LocalDateTime expireTime,
      Integer maxUsers,
      Long maxStorage,
      Integer currentUsers,
      Long currentStorage,
      String logoUrl,
      String description,
      String customDomain,
      String contactEmail,
      String contactPhone) {}

  public record TenantCreate(
      String id,
      String tenantCode,
      String tenantName,
      TenantTypeEnum tenantType,
      IsolationModeEnum isolationMode,
      String databaseName,
      TenantStatusEnum status,
      String adminUserId,
      LocalDateTime expireTime,
      Integer maxUsers,
      Long maxStorage,
      String logoUrl,
      String description,
      String customDomain,
      String contactEmail,
      String contactPhone) {}

  public record KickoutTenantResponse(Integer kickedCount) {}

  public record SuperAdminStatsResponse(
      Long totalTenants,
      Long activeTenants,
      Long todayNewTenants,
      Long totalUsers,
      Long onlineUsers,
      Long todayNewUsers,
      Long onlineTenants) {}

  public record TenantOnlineStatusResponse(
      String tenantId, String tenantCode, String tenantName, Long onlineCount) {}

  public record BanTenantRequest(String reason, Integer days) {}

  public record BanUserRequest(String reason, Integer days) {}
}
